import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import goodsInput from '../views/goodsInput.vue'
import layout from '../views/layout'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home',
    name: 'home',
    component: layout,
    children: [
      {
        path: 'home',
        name: 'home',
        component: Home
      },
      {
        path: 'goodsInput',
        name: 'goodsInput',
        component: goodsInput
      }
    ]
  },
  {
    path: '',
    redirect: '/home'
  }
]

const router = new VueRouter({
  routes
})

export default router
